#include <vector>
#include "cell.h"
#include "adapt_prec_arith.h"

cell::cell(double x_, double y_)
{
	x = x_;
	y = y_;
};

bool cell::operator!=(cell const& arg) const
{
	return !((x == arg.x)&&(y == arg.y));
};

int cell::left_turn_for_cell(double a_x, double a_y, double b_x, double b_y)
{
        double e = 4 * std::numeric_limits<double>::epsilon();
        e *= std::abs((b_x - a_x) * (y - a_y)) + std::abs((b_y - a_y) * (x - a_x));
        double result = (b_x - a_x) * (y - a_y) - (b_y - a_y) * (x - a_x);
        if (std::abs(result) > e)
        {
                if (result > 0)
                {
                        return 1;
                }
                if (result < 0)
                {
                        return -1;
                }
        }
        return left_turn_apa(a_x, a_y, b_x, b_y, x, y);
};
